﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// PhanLop Repository. Good example of CRUD operations.
    ///// </summary>
    public class PhanLopRepository : IPhanLopRepository
    {
        private static readonly IPhanLopDao _phanLop = DataAccess.PhanLopDao;
        public List<PhanLop> GetList()
        {
            return _phanLop.GetPhanLop().ToList();
        }

        public PhanLop Get(string id)
        {
            return _phanLop.GetPhanLopByID(id);
        }

        public void Insert(PhanLop t)
        {
            _phanLop.InsertPhanLop(t);
        }

        public void Update(PhanLop t)
        {
            _phanLop.UpdatePhanLop(t);
        }

        public void Delete(PhanLop t)
        {
            _phanLop.DeletePhanLop(t);
        }



        public List<PhanLop> GetPhanLopBySchoolIdAndSchoolYearID(string SchoolYearID, int schoolId)
        {
            return _phanLop.GetPhanLopBySchoolIdAndSchoolYearID(SchoolYearID, schoolId);
        }


        public List<PhanLop> GetPhanLopBySchoolIdAndSchoolYearIDAndClassID(string SchoolYearID, int schoolId, string ClassID)
        {
            return _phanLop.GetPhanLopBySchoolIdAndSchoolYearIDAndClassID(SchoolYearID, schoolId, ClassID);
        }


        public void DeleteStudentFromPhanLop(string studentID)
        {
            _phanLop.DeleteStudentFromPhanLop(studentID);
        }
    }
}